#include<stdio.h>
#include<stdlib.h>
#include<string.h>
#define null 0
typedef struct student
{
    char name[20];
    char num[100];
    float score;
    struct student *next;
}student;

typedef struct head
{
    int n;
    float ave;
    student *next;
}head;


head *Creat()
{
    float sum = 0;
    head *h;
    student *p,*t;
    p = (student*)malloc(sizeof(student));
    h = (head*)malloc(sizeof(head));

    h->n = 0;
    h->next = null;    
    t = p;
    while (1)
    {
        scanf("%s",p->name);if (p->name[0] == '*') {break;}
        scanf("%s",p->num);
        scanf("%f",&p->score);
        sum += p->score;
        p->next = null;

        if (h->n == 0)
        {
            h->next = p;
        }
        else t->next=p;        
        t = p;
        p = (student*)malloc(sizeof(student));
        h->n++;

    }
    h->ave = sum/h->n;
    return h;
}

int main(void)
{
    head *H,*H1;
    student *P,*N,*T;
    int a = H->n;
    P = (student*)malloc(sizeof(student));
    H1 = (head*)malloc(sizeof(head));
    H1->next = null;
    H1->n = 0;
    T = P;

    H = Creat();
    P = H->next;
    for (int i = 0; i < H->n; i++)
    {
        if (P->score>H->ave)
        {
            if (H1->n == 0)
            {
                H1->next = P;
                T = H1->next;
            }
            else T->next=P;
            T = P;
            H1->n++;
        }
        P = P->next;
    }
    for (int i = 0; i < H1->n; i++)
    {
        if (i==0)
        {
            printf("%s\n",H1->next->name);
            P = H1->next;            
        }
        else
        printf("%s\n",P->name);
        P = P->next;
    }
    
}